/*********************************************************************
	Rhapsody	: 7.5 
	Login		: kbe
	Component	: DefaultComponent 
	Configuration 	: CodeConfig
	Model Element	: Reactor
//!	Generated Date	: Thu, 27, Sep 2012  
	File Path	: DefaultComponent\CodeConfig\Reactor.h
*********************************************************************/

#ifndef Reactor_H
#define Reactor_H

//#[ ignore
#ifdef _MSC_VER
// disable Microsoft compiler warning (debug information truncated)
#pragma warning(disable: 4786)
#endif
//#]

//## auto_generated
#include <oxf\oxf.h>
//## auto_generated
#include <string>
//## auto_generated
#include <algorithm>
//## auto_generated
#include "Default.h"
//## auto_generated
#include <iterator>
//## link itsEventHandler
#include "EventHandler.h"
//## auto_generated
#include <map>
//## auto_generated
#include <oxf\OMValueCompare.h>
//## auto_generated
#include "SOCK_WrapperFacade.h"
//## dependency SimulatorReactorImplementation
class SimulatorReactorImplementation;

//## dependency SocketReactorImplementation
class SocketReactorImplementation;

//## package Default

//## class Reactor
class Reactor {
    ////    Constructors and destructors    ////
    
public :

    //## auto_generated
    virtual ~Reactor();
    
    ////    Operations    ////
    
    //## operation handleEvents(int)
    virtual void handleEvents(int time = 0);
    
    //## operation instance()
    static Reactor * instance();
    
    //## operation registerHandler(EventHandler,Event_Type)
    virtual void registerHandler(EventHandler& eh, const Event_Type& et);
    
    //## operation removeHandler(EventHandler,Event_Type)
    void removeHandler(EventHandler& eh, const Event_Type& et);
    
    ////    Additional operations    ////
    
    ////    Attributes    ////

protected :

    static Reactor* reactor_impl_;		//## attribute reactor_impl_
    
    ////    Relations and components    ////

public :

    //## operation Reactor()
    Reactor();
    
    //## operation registerHandler(HANDLE,EventHandler,Event_Type)
    virtual void registerHandler(HANDLE h, EventHandler& eh, const Event_Type& et);
    
    //## operation removeHandler(HANDLE,Event_Type)
    void removeHandler(HANDLE h, const Event_Type& et);
    
    //## auto_generated
    std::map<HANDLE, EventHandler*>::const_iterator getItsEventHandler() const;
    
    //## auto_generated
    std::map<HANDLE, EventHandler*>::const_iterator getItsEventHandlerEnd() const;
    
    //## auto_generated
    void removeItsEventHandler(EventHandler* p_EventHandler);
    
    //## auto_generated
    void clearItsEventHandler();

protected :

    //## auto_generated
    void cleanUpRelations();
    
    std::map<HANDLE, EventHandler*> itsEventHandler;		//## link itsEventHandler

public :

    //## auto_generated
    void _removeItsEventHandler(EventHandler* p_EventHandler);
    
    //## auto_generated
    void _clearItsEventHandler();

private :

    //## auto_generated
    static void setReactor_impl_(Reactor* p_reactor_impl_);
    
    //## auto_generated
    static Reactor* getReactor_impl_();

protected :

    //## operation addHandle(HANDLE,Event_Type)
    virtual void addHandle(HANDLE handle, const Event_Type& type);
    
    //## operation createHandleList()
    void createHandleList();

public :

    //## auto_generated
    EventHandler* getItsEventHandler(HANDLE key) const;
    
    //## auto_generated
    void removeItsEventHandler(HANDLE key);
    
    //## auto_generated
    void _removeItsEventHandler(HANDLE key);

protected :

    std::map<HANDLE, EventHandler*>::const_iterator iteratorEventHandler;		//## attribute iteratorEventHandler

private :

    //## auto_generated
    std::map<HANDLE, EventHandler*>::const_iterator getIteratorEventHandler() const;
    
    //## auto_generated
    void setIteratorEventHandler(std::map<HANDLE, EventHandler*>::const_iterator p_iteratorEventHandler);

public :

    //## operation deactivateHandle(HANDLE,Event_Type)
    void deactivateHandle(HANDLE h, Event_Type& et);
    
    //## operation reactivateHandle(HANDLE,Event_Type)
    void reactivateHandle(HANDLE h, Event_Type& et);
    
    //## auto_generated
    void addItsEventHandler(HANDLE key, EventHandler* p_EventHandler);
    
    //## auto_generated
    void _addItsEventHandler(HANDLE key, EventHandler* p_EventHandler);
};

////    Constructors and destructors    ////

////    Operations    ////

////    Additional operations    ////

////    Attributes    ////

#endif
/*********************************************************************
	File Path	: DefaultComponent\CodeConfig\Reactor.h
*********************************************************************/
